export default store => {
    console.log(store.state.Cart.cart)
    //subscribed的作用就是订阅state的变化,只要state发生变化就会回调subscribe中的函数
    store.subscribe((mutations, state) => {

        // console.log(mutations,state)
        // console.log(state.Cart.cart)
        if (mutations.type === 'Cart/SET_TO_CART') {
            //延迟两秒,重新提交新的状态
            setTimeout(() => {
                store.commit("CHANGE_NAME")
            }, 2000);
        }

        console.log(state.name)

    })
}